package com.shy;

/**
 * Created by huangyang on 2017/2/1.
 */
public class PrototypePatternDemo {
    public static void main(String[] args) throws CloneNotSupportedException {
        ShapeCache.loadShape();

        Shape clonedShape = (Shape)ShapeCache.getShape("1");
        System.out.println("Shape : " + clonedShape.getType());

        Shape cloneShape2 = (Shape)ShapeCache.getShape("2");
        System.out.println("Shaoe : " + cloneShape2.getType());

        Shape cloneShape3 = (Shape)ShapeCache.getShape("3");
        System.out.println("Shape : " + cloneShape3.getType());

    }
}
